<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
			<meta name="viewport" content="width=device-width, initial-scale=1.0">
	        <link rel="stylesheet" href="css/nav.css">
	        <link rel="stylesheet" href="bootstrap-3.3.5/css/bootstrap.css">
		<title>学生课程管理界面</title>
<link href="css/index.css" rel="stylesheet" type="text/css" /> 
<script type="text/javascript" src="js/jquery.1.4.2-min.js"></script>
<script type="text/javascript" src="js/Calculation.js"></script>
<script type="text/javascript">
$(document).ready(function () {    
	$(".allselect").click(function () {
		
		if($(this).attr("checked")){
			$(".stc_tb2 input[name=newslist]").each(function () {
				$(this).attr("checked", true);
			});
			GetCount();	
		}
		else
   		{
			$(".stc_tb2 input[name=newslist]").each(function () {
				if ($(this).attr("checked")) {
					$(this).attr("checked", false);
				} else {
					$(this).attr("checked", true);
				} 
			});
			GetCount();   
   		}		
	});
	$("#invert").click(function () {
		$(".stc_tb2 input[name=newslist]").each(function () {
			if ($(this).attr("checked")) {
				$(this).attr("checked", false);
			} else {
				$(this).attr("checked", true);
			} 
		});
		GetCount();
	});

	$("#cancel").click(function () {
		$(".stc_tb2 input[name=newslist]").each(function () {
			$(this).attr("checked", false);
		});
		GetCount();
	});
	$(".stc_tb2 input[name=newslist]").click(function () {
		if ($(this).attr("checked")) {
		} else {
		}
	});
	$(".stc_tb2 input[name=newslist]").click(function () {
		GetCount();
	});
});
</script>
</head>
	<style>
	.form-inline{
		margin-top: 50px;
		margin-left: 300px;
		font-family: "微软雅黑";
		font-size: 16px;

	}
	#exampleInputSearch{
		margin-left:400px;	
	}
	#sx{
		font-family: "微软雅黑";
		font-size:17px ;
		text-align: center;
		color: #555469;
	} 
	
	</style>
	<body>
<form class="form-inline">
  <div class="form-group">
    输入学院：<label class="sr-only" for="exampleInputacademy">academy</label>
        <input type="text" class="form-control" id="exampleInputacademy" name="exampleInputacademy" placeholder="academy">
  </div>
  
  <div class="form-group">
    输入班级：<label class="sr-only" for="exampleInputclass">class</label>
        <input type="text" class="form-control" id="exampleInputclass" name="exampleInputclass" placeholder="class">
  </div> 
  <div class="form-group">
   输入专业： <label class="sr-only" for="exampleInputprofessional">professional</label>
        <input type="text" class="form-control" id="exampleInputProfessional" name="exampleInputProfessional" placeholder="Professional">
  </div></br></br></br>
  
  <button type="submit" class="btn btn-default"  id="exampleInputSearch" onclick="Search()">Search</button>
</form>
<script type="text/javascript">
	 $(function Search(){
            $.ajax({
                type: "get",
                url: "stucoursedata.json",
                dataType: "json",
　　　　　　　　　       success: function(result){
                addBox(result);
                }
            });
        });

        function addBox(result){
                //result是一个集合,所以需要先遍历
	            $.each(result,function(index,obj){
	            
	                $(".tb2_td2").append(obj['snumber']);
	                $(".tb2_td3").append(obj['name']);
	                $(".tb2_td4").append(obj['class']);
	            });
        }
 	
</script>

<hr style="height:1px;border:none;border-top:1px solid #E0E0E0" /></br> 
<div class="stc" style=" margin:auto;">
	<table cellpadding="0" cellspacing="0" class="stc_tb1">
		<tr>
			<td class="tb1_td1"><input id="Checkbox1" type="checkbox"  class="allselect"/></td>
			<td class="tb1_td1">全选</td>
			<td class="tb1_td3">学号</td>
			<td class="tb1_td4">姓名</td>
			<td class="tb1_td5">班级</td>
		</tr>
	</table>
<div id="box">
	   <table cellpadding="0" cellspacing="0" class="stc_tb2">
		<tr>
			<td class="tb2_td1"><input type="checkbox" value="1" name="newslist" id="newslist-2" /></td>
			<td class="tb2_td2"></td>
			<td class="tb2_td3"></td>
			<td class="tb2_td4"></td>
		</tr>
       </table>
</div>
	
	<table cellpadding="0" cellspacing="0" class="stc_tb6">
		<tr>
			<td class="tb6_td1"><button style="border: solid;border-color: #9E9E9E;border-radius: 8px;width: 110px;height: 30px;" onClick="look_course()">查看课表</button></td>
			<td class="tb6_td3"><button style="border: solid;border-color: #9E9E9E;border-radius: 8px;width: 110px;height: 30px;" onClick="look_person()">个人中心</button></td>
			<td class="tb6_td2"><button style="border: solid;border-color: #9E9E9E;border-radius: 8px;width: 110px;height: 30px;" onClick="incdel_course()">增删课程</button></td>	
		</tr>
	</table>
	
</div>
<script type="text/javascript">
	function incdel_course(){
	window.open("del_increase.html","_blank","top=120px,left=200,width=970,height=400,menubar=no,toolbar=no,scrollbars=yes")
		 
	}
	
	function look_course(){
		window.open("weekly_calendar.html","_blank","top=40px,left=80,width=1100,height=600,menubar=no,toolbar=no,scrollbars=yes")
		 
	}
	function look_person(){
	window.open("ad_studentinformation.html","_blank","top=120px,left=200,width=970,height=400,menubar=no,toolbar=no,scrollbars=yes")
		 
	}
	
</script>
   
	</body>
</html>
